home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Belgian Amiga Club - ADF Collection
/
BS1 part 19.zip
/
BS1 part 19
/
how to learn assembler.adf
/
CH4
/
4_3_3Ahex-ascii.asm
< prev
next >
Wrap
Assembly Source File
|
1988-02-25
|
509b
|
20 lines
;(4.3.3A) ascii-hex
move.l #string,a0 ;pointer to string with B in A0
jsr nibblein
nop
nibblein: ; Convert the nibble from (A0)
clr.l d0 ; Erase D0
move.b (a0)+,d0 ; Get digit, increment A0
sub #'A',d0 ; Subtract $41
bcc ischar ; No problem, in the range A-F
add #7,d0 ; Else correct value
ischar:
add #10,d0 ; Correct value
rts
string: dc.b 'B',0 ;char to convert
end